{% extends "jinhtml/skel.html" %}
{% block headcss %}
  <link rel="stylesheet" href="css/month.css" type="text/css">
{% endblock %}

{% block onload %}
  setyearmonth();
  setmonthcal();
  setfocusblock(value_date);
  var switchmonthobj = document.getElementById("switchmonth");
  switchmonthobj.className += "selected";
  switchmonthobj.onclick = "";
{% endblock %} 
  
{% block headjs %}
  <script src="js/month.js" type="text/javascript"></script>
  <script src="js/caledit.js" type="text/javascript"></script>
  <script src="js/data.js" type="text/javascript"></script>
  <script type="text/javascript">
    var shortcut_mainmsg = "(Ctrl-L)清單模式 (Ctrl-左右)切換月份 (y)修改年 " + 
      "(m)修改月 (Enter)查看或編輯資料 (0-9)快速選擇日期";
  	shortcut_bind();
  </script>
{% endblock %}

{% block body %}
  <div name="calbrowse" id="timeselect">
    <input type="button" value="<" id="timeselect_prev" onclick="timeselect_prev()">
    <span id="timeselect_year" onclick="timeselect_direct()">XXXX</span>
    <input type="text" maxlength="4" id="timeedit_year">
    年
    <span id="timeselect_month" onclick="timeselect_direct()">XX</span>
    <input type="text" maxlength="2" id="timeedit_month">
    月 
    <input type="button" value=">" id="timeselect_fwd" onclick="timeselect_fwd()">
    <input type="button" value="改" id="timeedit_button" onclick="timeselect_direct()">
    <input type="button" value="確定" id="timeedit_apply" onclick="timeedit_apply()">
    <input type="button" value="取消" id="timeedit_cancel" onclick="timeedit_cancel()">
  </div>
  <div name="calbrowse" style="text-align: center;">
      <input type="text" maxlength="2" id="focusjumper" style="display: none;">
  </div>
  <div name="calbrowse" id="monthcal">
    <table id="cal">
      <thead>
        <tr>
          <td>週日</td>
          <td>週一</td>
          <td>週二</td>
          <td>週三</td>
          <td>週四</td>
          <td>週五</td>
          <td>週六</td>
        </tr>
      </thead>
      <tbody id="calbody">
      </tbody>
    </table>
  </div>
  <div name="caldetail" id="caleditor" style="display: none;">
    <div style="text-align: center;">
        <input type="button" value="返回月曆" style="background-color: #00FF00; font-size: large;" onclick="caledit_quit()">
    </div>
    <div id="caledit_left">
      <select id="caledit_select" size="20" onchange="caledit_loader(this)">
      </select>
    </div>
    <div id="caledit_right">
      <form id="calform" name="caleditform" onsubmit="return caledit_save_func()">
        <input id="caledit_delete" type="button" value="刪除" onclick="caledit_delete_func()">
        <input id="caledit_switchedit" type="button" value="編輯" onclick="caledit_edit()">
        <span id="caledit_enabled"></span>
        <fieldset>
          <legend>詳細資料</legend>
          日期：
          <span name="caledit_read" id="caledit_static_year"></span>
          <input name="caledit_write" id="caledit_dyn_year" type="text" maxlength="4">
          年
          <span name="caledit_read" id="caledit_static_month"></span>
          <input name="caledit_write" id="caledit_dyn_month" type="text" maxlength="2">
          月
          <span name="caledit_read" id="caledit_static_date"></span>
          <input name="caledit_write" id="caledit_dyn_date" type="text" maxlength="2">
          日
          <br>
          時間：
          <span name="caledit_read" id="caledit_static_hour"></span>
          <input name="caledit_write" id="caledit_dyn_hour" type="text" maxlength="2">
          時
          <span name="caledit_read" id="caledit_static_minute"></span>
          <input name="caledit_write" id="caledit_dyn_minute" type="text" maxlength="2">
          分
          <br>
          提醒：
          <span name="caledit_read" id="caledit_static_remind"></span>
          <input name="caledit_write" id="caledit_dyn_remind" type="text" maxlength="5">
          分鐘前
          <br>
          標題：
          <span name="caledit_read" id="caledit_static_title"></span>
          <input name="caledit_write" id="caledit_dyn_title" type="text">
          <br>
          內容：
          <div><pre name="caledit_read_block" id="caledit_static_content"></pre></div>
          <textarea name="caledit_write_block" id="caledit_dyn_content" rows="6"></textarea>
          資料來源：
          <span id="caledit_datafrom"></span>
        </fieldset>
        <input id="caledit_save" type="submit" value="儲存">
        <input id="caledit_discard" type="button" value="重設" onclick="caledit_discard_func()">
      </form>
    </div>
  </div>
{% endblock %}
